--- ./src/modules/rlm_sql/sql.c.orig
+++ ./src/modules/rlm_sql/sql.c
@@ -33,6 +33,7 @@
 #include	<sys/stat.h>
 
 #include	<ctype.h>
+#include	<fcntl.h>
 
 #include	"rlm_sql.h"
 
